﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Diagnostics;

namespace Lilium.Web.Mvc
{
	[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
	public sealed class DisplayAttribute : Attribute
	{
		#region public string ViewName

		private string m_ViewName;

		public string ViewName
		{
			[DebuggerNonUserCodeAttribute]
			get
			{
				return m_ViewName;
			}
			[DebuggerNonUserCodeAttribute]
			set
			{
				m_ViewName = value;
			}
		}

		#endregion

		#region public bool Scaffold

		private bool m_Scaffold = true;

		public bool Scaffold
		{
			[DebuggerNonUserCodeAttribute]
			get
			{
				return m_Scaffold;
			}
			[DebuggerNonUserCodeAttribute]
			set
			{
				m_Scaffold = value;
			}
		}

		#endregion

		#region public string TemplateName

		private string m_TemplateName;

		public string TemplateName
		{
			[DebuggerNonUserCodeAttribute]
			get
			{
				return m_TemplateName;
			}
			[DebuggerNonUserCodeAttribute]
			set
			{
				m_TemplateName = value;
			}
		}

		#endregion

		#region public bool HideSurroundingChrome 

		private bool m_HideSurroundingChrome ;

		public bool HideSurroundingChrome 
		{
			[DebuggerNonUserCodeAttribute]
			get
			{
				return m_HideSurroundingChrome ;
			}
			[DebuggerNonUserCodeAttribute]
			set
			{
				m_HideSurroundingChrome  = value;
			}
		}

		#endregion

		public override object TypeId
		{
			get
			{
				var name = this.GetType().AssemblyQualifiedName;
				if (!string.IsNullOrEmpty(ViewName))
					name = name + "_" + ViewName;
				return name;
			}
		}
	}
}